package com.zm.demo.shoppingmall.gateway.controller;

import com.zm.demo.shoppingmall.common.response.ShoppintMallResponse;
import com.zm.demo.shoppingmall.gateway.service.OrderManager;
import com.zm.demo.shoppingmall.order.model.TOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc:
 *  交易：下单，付款，发货，确认收货，退货
 * @author: z01140
 * @date: 2021/5/25 10:55
 */
@RestController
@RequestMapping("/trans")
public class TransController {

    @Autowired
    private OrderManager orderManager;

    @PostMapping("/order")
    public ShoppintMallResponse order(@RequestBody TOrder order){
        int r = orderManager.order(order);
        return ShoppintMallResponse.response(0, "", r);
    }
}
